import com.sun.xml.internal.ws.api.server.Adapter;

import javax.swing.*;
import java.awt.*;

/**
 * Created by Brill on 2016/1/1.
 */
public class FrameUtil {

    public static void initFrame(JFrame frame, int width, int hight) {
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        Dimension d = toolkit.getScreenSize();
        frame.setBounds((int) (d.getWidth() / 2), (int) (d.getHeight() / 2), width, hight);
        frame.setVisible(true);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    }
}
